Auth and User
Register a new user
Creates a new user account in the system with the provided credentials and information.
POST
/
auth
/
register
Register a new user
curl --request POST \
--url https://your_a2_service/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"password": "<string>",
"permissions": {},
"role": "<string>",
"budget": 0,
"credit": 0,
"is_active": true,
"is_superuser": false,
"is_verified": false,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
}
}
'import requests
url = "https://your_a2_service/auth/register"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"password": "<string>",
"permissions": {},
"role": "<string>",
"budget": 0,
"credit": 0,
"is_active": True,
"is_superuser": False,
"is_verified": False,
"preferences": {
"etc": { "language": "ko" },
"notification_methods": {
"email": True,
"slack": False,
"sms": False
},
"notification_methods_data": {
"slack": "",
"sms": ""
},
"notifications": {
"attribute_deleted": True,
"campaign_finished": True,
"publish_approval": True,
"publish_request": True
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
name: '<string>',
password: '<string>',
permissions: {},
role: '<string>',
budget: 0,
credit: 0,
is_active: true,
is_superuser: false,
is_verified: false,
preferences: {
etc: {language: 'ko'},
notification_methods: {email: true, slack: false, sms: false},
notification_methods_data: {slack: '', sms: ''},
notifications: {
attribute_deleted: true,
campaign_finished: true,
publish_approval: true,
publish_request: true
}
}
})
};
fetch('https://your_a2_service/auth/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/auth/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'name' => '<string>',
'password' => '<string>',
'permissions' => [
],
'role' => '<string>',
'budget' => 0,
'credit' => 0,
'is_active' => true,
'is_superuser' => false,
'is_verified' => false,
'preferences' => [
'etc' => [
'language' => 'ko'
],
'notification_methods' => [
'email' => true,
'slack' => false,
'sms' => false
],
'notification_methods_data' => [
'slack' => '',
'sms' => ''
],
'notifications' => [
'attribute_deleted' => true,
'campaign_finished' => true,
'publish_approval' => true,
'publish_request' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/auth/register"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/auth/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}Body
application/json
Represents a create command for a user.
Required range:
x >= 0Required range:
x >= 0Represents a user preferences.
Show child attributes
Show child attributes
Response
Successful Response
Represents a read command for a user.
The total budget currently available to the user.
The number of campaigns owned by the user.
Required range:
x >= 0The number of creatives owned by the user.
Required range:
x >= 0The total credit currently available to the user.
The email of the user.
The id of the user.
Is the user active.
Is the user admin.
Is the user email is verified.
The permissions information of the user.
Examples:
{}
{
"admin": [],
"advertiser": ["permission"],
"analytic": ["campaign"],
"audience": [],
"audience_attribute": ["r"],
"audience_segment": ["r", "w"],
"campaign": ["r", "w"],
"creative": ["r", "w"],
"placement": ["r"],
"retailer": []
}
{
"admin": ["list_advertisers", "budget"],
"advertiser": [],
"analytic": ["placement"],
"audience": ["r"],
"audience_attribute": ["r", "w"],
"audience_segment": ["r", "w"],
"campaign": ["r"],
"creative": ["r", "w"],
"placement": ["r", "w"],
"retailer": ["approval", "permission"]
}
The number of placements owned by the user.
Required range:
x >= 0Represents a user preferences.
Show child attributes
Show child attributes
User role enum.
Available options:
advertiser, retailer, admin The name of the user.
Was this page helpful?
⌘I
Register a new user
curl --request POST \
--url https://your_a2_service/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"password": "<string>",
"permissions": {},
"role": "<string>",
"budget": 0,
"credit": 0,
"is_active": true,
"is_superuser": false,
"is_verified": false,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
}
}
'import requests
url = "https://your_a2_service/auth/register"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"password": "<string>",
"permissions": {},
"role": "<string>",
"budget": 0,
"credit": 0,
"is_active": True,
"is_superuser": False,
"is_verified": False,
"preferences": {
"etc": { "language": "ko" },
"notification_methods": {
"email": True,
"slack": False,
"sms": False
},
"notification_methods_data": {
"slack": "",
"sms": ""
},
"notifications": {
"attribute_deleted": True,
"campaign_finished": True,
"publish_approval": True,
"publish_request": True
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
name: '<string>',
password: '<string>',
permissions: {},
role: '<string>',
budget: 0,
credit: 0,
is_active: true,
is_superuser: false,
is_verified: false,
preferences: {
etc: {language: 'ko'},
notification_methods: {email: true, slack: false, sms: false},
notification_methods_data: {slack: '', sms: ''},
notifications: {
attribute_deleted: true,
campaign_finished: true,
publish_approval: true,
publish_request: true
}
}
})
};
fetch('https://your_a2_service/auth/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your_a2_service/auth/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'name' => '<string>',
'password' => '<string>',
'permissions' => [
],
'role' => '<string>',
'budget' => 0,
'credit' => 0,
'is_active' => true,
'is_superuser' => false,
'is_verified' => false,
'preferences' => [
'etc' => [
'language' => 'ko'
],
'notification_methods' => [
'email' => true,
'slack' => false,
'sms' => false
],
'notification_methods_data' => [
'slack' => '',
'sms' => ''
],
'notifications' => [
'attribute_deleted' => true,
'campaign_finished' => true,
'publish_approval' => true,
'publish_request' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your_a2_service/auth/register"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your_a2_service/auth/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"permissions\": {},\n \"role\": \"<string>\",\n \"budget\": 0,\n \"credit\": 0,\n \"is_active\": true,\n \"is_superuser\": false,\n \"is_verified\": false,\n \"preferences\": {\n \"etc\": {\n \"language\": \"ko\"\n },\n \"notification_methods\": {\n \"email\": true,\n \"slack\": false,\n \"sms\": false\n },\n \"notification_methods_data\": {\n \"slack\": \"\",\n \"sms\": \"\"\n },\n \"notifications\": {\n \"attribute_deleted\": true,\n \"campaign_finished\": true,\n \"publish_approval\": true,\n \"publish_request\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"budget": 123,
"campaign_count": 1,
"creative_count": 1,
"credit": 123,
"email": "jsmith@example.com",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"is_superuser": true,
"is_verified": true,
"permissions": {},
"placement_count": 1,
"preferences": {
"etc": {
"language": "ko"
},
"notification_methods": {
"email": true,
"slack": false,
"sms": false
},
"notification_methods_data": {
"slack": "<SLACK_WEBHOOK_URL>",
"sms": ""
},
"notifications": {
"attribute_deleted": true,
"campaign_finished": true,
"publish_approval": true,
"publish_request": true
}
},
"role": "advertiser",
"name": "<string>"
}